package com.renjian.funplaypro.utils;

import com.renjian.funplaypro.services.UserMessageService;
import com.renjian.funplaypro.services.UserService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import javax.annotation.Resource;

/**
 * @author Gjing
 **/
@Configuration
public class WebsocketConfiguration {

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    @Resource
    public void setChatServie(UserMessageService chat){
        MyWebsocketServer.chatMessageService=chat;
    }

    @Resource
    public void setUserService(UserService user){
        MyWebsocketServer.userService=user;
    }
}
